<?php
require("../lib/phpmailer/class.phpmailer.php");
require("../lib/phpmailer/class.smtp.php");
//require("class.phpmailer.php");

		$mail = new PHPMailer(); 
		$mail->IsSMTP(); 
		$mail->Port = 465; 
		$mail->Host = 'smtp.gmail.com'; 
		$mail->IsHTML(true); 
		$mail->Mailer = 'smtp'; 
		$mail->SMTPSecure = 'ssl'; 
		//$mail->SMTPSecure = 'tls';
		$mail->SMTPAuth = true; 
		$mail->Username = "teste.cetil@gmail.com"; 
		$mail->Password = "casinha1"; 
		$mail->SingleTo = true;
		//$from = $this -> "rv.thiagovieira@gmail.com";
		//$fromname = $this -> "thiago";
		
		$mail->From = "nasket.inc@gmail.com"; // Seu e-mail
		$mail->FromName = "Handel"; // Seu nome
		
		$mail->IsHTML(true);
		$mail->CharSet = 'iso-8859-1';
	
		$body = "";
		$body .= "<html>";
		$body .= "   <head>";
		$body .= "      <title>Handel</title>";
		$body .= "   </head>";
		$body .= "   <body>";
		$body .= "      <fieldset style='background-color:#07162E'>";
		$body .= "         <img src='https://lh4.googleusercontent.com/-wdG0MRrR734/VX15141Za2I/AAAAAAAAAH0/RoXtBQgS6pU/w189-h48-no/imagem_email.png'></img>";
		$body .= "         </br>";
		$body .= "         </br>";
		$body .= "         <p style='color:white'>Caro(a) <i><u>".$nome_dono."</u></i></p>";
		$body .= "         </br>";
		$body .= "         <fieldset style='background-color:#CCCCCC'>";
		$body .= "            <div id 'teste'>";
		$body .= "            <p><b> Voc&ecirc; recebeu uma nova proposta de <u><i>".$nome_interessado."</i></u><b></p>";
		$body .= "            <p>";
		$body .= "         </p>";		
		$body .= "         <p>";
		$body .= "         </p>";
		$body .= "         <div>  ";
		$body .= "            <p>Este e-mail foi enviado para ".$email_interessado.". </p>";
		$body .= "            <p>Voc&ecirc; est&aacute; recebendo este e-mail porque voc&ecirc; &eacute; um membro registrado do handel.com.</p>";
		$body .= "            <p>Leia nossa Pol&iacute;tica de Privacidade e Termos de Uso se voc&ecirc; tiver quaisquer perguntas.</p>";
		$body .= "            <p>Handel Service Center: nasket.inc@gmail.com</p>";
		$body .= "            <p>Att, HANDEL</p>";
		$body .= "         </div>";
		$body .= "         </fieldset>";
		$body .= "      </fieldset>";
		$body .= "   </body>";
		$body .= "</html>";

/*		
		$body = "<!DOCTYPE html>";
		$body .= "<html>";
		$body .= "   <head>";
		$body .= "      <title>Handel</title>";
		$body .= "   </head>";
		$body .= "   <body>";
		$body .= "      <fieldset style='background-color:#07162E'>"		
		$body .= "         <img src='https://lh4.googleusercontent.com/-wdG0MRrR734/VX15141Za2I/AAAAAAAAAH0/RoXtBQgS6pU/w189-h48-no/imagem_email.png'></img>";
		$body .= "         </br>";
		$body .= "         </br>";
		$body .= "         <p>Caro(a) <i>".$nome_dono."</i></p></br>";
		$body .= "         <div id='texto'></div>";
		$body .= "         </br>";
		$body .= "         <fieldset>";
		$body .= "            <div id 'teste'>";
		$body .= "               <p> Voc&ecirc; recebeu uma nova proposta de <u><i>".$nome_interessado."</i></u></p>";
		$body .= "               <p>Email:<i>".$email_interessado."</i></p>";
				
		$body .= "            </div>";
		$body .= "         </fieldset>";
		$body .= "      </fieldset>"
		$body .= "   </body>";
		$body .= "</html>";		
	*/
	
		$mail->addAddress($email_dono);
		$mail->Subject = "Voce possui uma nova proposta";
		$mail->Body = $body; //"MENSAGEM";
		$result = $mail->Send();
		/*if($result){
			echo 'Email enviado com Sucesso!';
		}
		else{
			echo 'Erro ao enviar email!  '. $mail->ErrorInfo;
		}*/
?>